package com.cjbdi.controller;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;

import org.hibernate.SQLQuery;
import org.hibernate.transform.Transformers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

import com.cjbdi.service.EqTyService;
import com.cjbdi.service.GzzsGkzsService;
import com.cjbdi.service.GzzsTszbService;
import com.cjbdi.service.GzzsWdzsService;
import com.cjbdi.service.HeadService;
import com.cjbdi.service.SfglCbrzsService;
import com.cjbdi.service.SfglCsxService;
import com.cjbdi.service.SfglFajhService;
import com.cjbdi.service.SfglGjljzsService;
import com.cjbdi.service.SfglRjjazsService;
import com.cjbdi.service.SfglYdjazsService;
import com.cjbdi.service.ShzlService;
import com.cjbdi.service.SpxgFpxszsService;
import com.cjbdi.service.SpxgZxjazsService;
import com.cjbdi.service.SpzxxlzsService;
import com.cjbdi.service.TFypzService;
import com.cjbdi.util.NumUtil;

@Service
public class DocumentHandler {
	@Autowired 
	GzzsGkzsService gzzsService;	
    
    @Autowired 
    SpzxxlzsService spzxxlzsService;
    
    //@Autowired 
    //TFypzService fFypzService;
    
    @Autowired
    GzzsWdzsService wdzsService;
    
    @Autowired
    SpxgFpxszsService fpxszsService;
    
    @Autowired
    SpxgZxjazsService zxjazsService;
    
    @Autowired
    SfglCbrzsService sfglcbrzsService;
    
    @Autowired
    SfglYdjazsService sfglydjazsService;
    
    @Autowired
    SfglGjljzsService sfglgjljzsService;
    
    @Autowired
    ShzlService shzlService;
    
    @Autowired
    HeadService headService;
    
    @Autowired
    SfglCsxService sfglCsxService;
    
    @Autowired
    SfglRjjazsService sfglRjjazsService;
    
    @Autowired
    SfglFajhService sfglFajhService;
    
    @Autowired
    EqTyService eqTyService;
    
    @Autowired
    Environment env;
    
    @Autowired
    GzzsTszbService gzzsTszbService;
    
    @Autowired 
    TFypzService tFypzService; 

	private Configuration configuration = null;

	public DocumentHandler() {

		configuration = new Configuration();

		configuration.setDefaultEncoding("utf-8");

	}

	public void createDoc(String kind, String templatePath, String templateName, String reportPath, String reportName, String fymc, String searchType,
			String date, String fybm) {
		// List list = tFypzService.findZs();
		// 要填入模本的数据文件
		System.out.println("正在生成："+fybm+"-"+reportName);
		Map dataMap = new HashMap();
		getData(dataMap, kind, searchType, date, fybm, fymc , reportPath, templateName)	;//为模板准备数据
		try {
			configuration.setDirectoryForTemplateLoading(new File(templatePath));
		} catch (IOException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		Template t = null;
		try {
			// test.ftl为要装载的模板
			t = configuration.getTemplate(templateName);
			t.setEncoding("utf-8");
		} catch (IOException e) {
			e.printStackTrace();
		}
		// 输出文档路径及名称
		File outFile = new File(reportPath + reportName);
		File fileParent = outFile.getParentFile();
		if(!fileParent.exists()){
			fileParent.mkdirs();
		}
		Writer out = null;
		try {
			out = new BufferedWriter(new OutputStreamWriter(
					new FileOutputStream(outFile), "utf-8"));
		} catch (Exception e1) {
			e1.printStackTrace();
		}
		try {
			t.process(dataMap, out);
			out.close();
		} catch (TemplateException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 
	 * 注意dataMap里存放的数据Key值要与模板中的参数相对应
	 * 
	 * 
	 * 
	 * @param dataMap
	 * 
	 */

	private void getData(Map dataMap,String kind, String type, String date, String fybm, String fymc, String reportPath, String templateName) {
		dataMap.put("createdate", NumUtil.GetNowDate("yyyy年MM月"));
		if(kind.equals("高")) {
			dataMap.put("fy", NumUtil.toSheng(fymc));
		}else if(kind.equals("辖")) {
			dataMap.put("fy", fymc);
			dataMap.put("fyjc", fymc.replace("人民法院", ""));
		}else {
			dataMap.put("fy", fymc.replace("法院", ""));
		}	
		if(type.equals("up")) {
			dataMap.put("year", date+"上半");
			dataMap.put("lastyear", (Integer.parseInt(date)-1)+"上半");
			dataMap.put("yearbeforelastyear", (Integer.parseInt(date)-2)+"上半");
			dataMap.put("date_table", date+"上半");
			dataMap.put("hbyear1", ((Integer.parseInt(date)-1)+"上半").replace("20", ""));
			dataMap.put("hbyear2", ((Integer.parseInt(date)-1)+"下半").replace("20", ""));
			dataMap.put("hbyear3", (date+"上半").replace("20", ""));
		}else if(type.equals("down")) {
			dataMap.put("year", date+"下半");
			dataMap.put("lastyear", (Integer.parseInt(date)-1)+"下半");
			dataMap.put("yearbeforelastyear", (Integer.parseInt(date)-2)+"下半");
			dataMap.put("date_table", date+"下半");
			dataMap.put("hbyear1", ((Integer.parseInt(date)-1)+"下半").replace("20", ""));
			dataMap.put("hbyear2", (date+"上半").replace("20", ""));
			dataMap.put("hbyear3", (date+"下半").replace("20", ""));
		}else {
			dataMap.put("year", date);
			dataMap.put("lastyear", (Integer.parseInt(date)-1)+"");
			dataMap.put("yearbeforelastyear", (Integer.parseInt(date)-2)+"");
			dataMap.put("date_table", (Integer.parseInt(date)-1)+"-"+date);
		}
		
		String csxdate =  env.getProperty("csx.date");
		dataMap.put("sfgl_csx_date", NumUtil.GetDate(csxdate,"yyyy年M月dd日"));
		dataMap.put("sfgl_csx_date_table", NumUtil.GetDate(csxdate,"yyyy-MM-dd"));
    	dataMap.put("sfgl_csx_lastyeardate_table", NumUtil.getPastDate(csxdate,"yyyy-MM-dd"));
    	dataMap.put("sfgl_csx_lastyeardate", NumUtil.getPastDate(csxdate,"yyyy"));
		/*String csxdate =  NumUtil.getLastMonthFinalDate();
		dataMap.put("sfgl_csx_date", NumUtil.GetDate(csxdate,"yyyy年M月dd日"));
		dataMap.put("sfgl_csx_date_table", NumUtil.getLastMonthFinalDate());
    	dataMap.put("sfgl_csx_lastyeardate_date", NumUtil.getLastYearLastMonthFinalDate("yyyy-MM-dd"));
    	dataMap.put("sfgl_csx_lastyeardate", NumUtil.getLastYearLastMonthFinalDate("yyyy"));*/
    	//headService.getheadzs(dataMap, kind, type, date, fybm);
		if(kind.equals("高")) {
			if(templateName.contains("spzx")) {
				headService.getheadzs(dataMap, kind, type, date, fybm);
				gzzsService.getGkzsGy(dataMap,kind, type,date,fybm,fymc);//公开指数
				gzzsTszbService.getTszbGy(dataMap, kind, type, date, fybm, fymc);
				wdzsService.getWdzsGy(dataMap,kind,type,date,fybm,fymc);//稳定指数
				spzxxlzsService.getSpZxzsGy(dataMap,kind, type, date,fybm,fymc,"sp");//审判效率指数
				spzxxlzsService.getSpZxzsGy(dataMap,kind, type, date,fybm,fymc,"zx");//执行效率指数
				fpxszsService.getFpxszsGy(dataMap,kind, type, date, fybm, fymc,"ysfp");//服判息诉指数
				zxjazsService.getZxjazsGy(dataMap,kind, type, date, fybm, fymc);
				sfglcbrzsService.getSpZxgzlzsGy(dataMap,kind, type, date, fybm, fymc,"sp");
				sfglcbrzsService.getSpZxgzlzsGy(dataMap,kind, type, date, fybm, fymc,"zx");
				sfglydjazsService.getYdjajhzsGy(dataMap,kind, type, date, fybm, fymc);
				sfglgjljzsService.getGjljzsGy(dataMap,kind, type, date, fybm, fymc);
				sfglCsxService.getCsxzsGy(dataMap,kind,csxdate,fybm, fymc);
				sfglRjjazsService.getRjajhzsGy(dataMap,kind, type, date, fybm, fymc);
				sfglFajhService.getFajhzsGy(dataMap, kind, type, date, fybm, fymc);
				eqTyService.getEqTyzsGy(dataMap,"cqcsx", kind, "year", csxdate, fybm, fymc);
				eqTyService.getEqTyzsGy(dataMap,"duren", kind, type, date, fybm, fymc);
				//eqTyService.getEqTyzsGy(dataMap,"esfp", kind, type, date, fybm, fymc);
				eqTyService.getEqTyzsGy(dataMap,"psy", kind, type, date, fybm, fymc);
				eqTyService.getEqTyzsGy(dataMap,"tj", kind, type, date, fybm, fymc);
			}else if(templateName.contains("jjsh")){
				shzlService.getShzlzsGy(dataMap, kind, "mjjd", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "lwjf", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "jrzp", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "dljt", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "rsaq", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "wcnqy", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "wcnfz", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "fnet", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "hdd", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "spaq", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "ypaq", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "grcc", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "jtjf", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "lljf", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "lyjf", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "zrzy", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "sthj", type, date, fybm, fymc);
			}else {
				headService.getheadzs(dataMap, kind, type, date, fybm);
				gzzsService.getGkzsGy(dataMap,kind, type,date,fybm,fymc);//公开指数
				gzzsTszbService.getTszbGy(dataMap, kind, type, date, fybm, fymc);
				wdzsService.getWdzsGy(dataMap,kind,type,date,fybm,fymc);//稳定指数
				spzxxlzsService.getSpZxzsGy(dataMap,kind, type, date,fybm,fymc,"sp");//审判效率指数
				spzxxlzsService.getSpZxzsGy(dataMap,kind, type, date,fybm,fymc,"zx");//执行效率指数
				fpxszsService.getFpxszsGy(dataMap,kind, type, date, fybm, fymc,"ysfp");//服判息诉指数
				zxjazsService.getZxjazsGy(dataMap,kind, type, date, fybm, fymc);
				sfglcbrzsService.getSpZxgzlzsGy(dataMap,kind, type, date, fybm, fymc,"sp");
				sfglcbrzsService.getSpZxgzlzsGy(dataMap,kind, type, date, fybm, fymc,"zx");
				sfglydjazsService.getYdjajhzsGy(dataMap,kind, type, date, fybm, fymc);
				sfglgjljzsService.getGjljzsGy(dataMap,kind, type, date, fybm, fymc);
				sfglCsxService.getCsxzsGy(dataMap,kind,csxdate,fybm, fymc);
				sfglRjjazsService.getRjajhzsGy(dataMap,kind, type, date, fybm, fymc);
				sfglFajhService.getFajhzsGy(dataMap, kind, type, date, fybm, fymc);
				eqTyService.getEqTyzsGy(dataMap,"cqcsx", kind, "year", csxdate, fybm, fymc);
				eqTyService.getEqTyzsGy(dataMap,"duren", kind, type, date, fybm, fymc);
				//eqTyService.getEqTyzsGy(dataMap,"esfp", kind, type, date, fybm, fymc);
				eqTyService.getEqTyzsGy(dataMap,"psy", kind, type, date, fybm, fymc);
				eqTyService.getEqTyzsGy(dataMap,"tj", kind, type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "mjjd", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "lwjf", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "jrzp", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "dljt", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "rsaq", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "wcnqy", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "wcnfz", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "fnet", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "hdd", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "spaq", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "ypaq", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "grcc", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "jtjf", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "lljf", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "lyjf", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "zrzy", type, date, fybm, fymc);
				shzlService.getShzlzsGy(dataMap, kind, "sthj", type, date, fybm, fymc);
			}
			//处理图片
			Map<Integer,String> mapImg = new HashMap<Integer,String>();
			for(Object key : dataMap.keySet()) {
				if(NumUtil.isNumeric(key.toString())) {
					String shengRank1 = (String)dataMap.get(key);
					mapImg.put(Integer.parseInt(key.toString()), shengRank1);
				}
			}
			
			if(fybm.startsWith("Z")) {
				for(int i=1;i<=71;i++) {
					if(i%2==0||i==1) {
						dataMap.put("image"+i, NumUtil.getImageStr(reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11)+"/img/qg/"+date+"/"+type+"/"+i+".png")); 
					}else {
						dataMap.put("image"+i, NumUtil.getImageStr(reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11)+"/img/qg/"+date+"/"+type+"/"+i+"/"+mapImg.get(i)+".png")); 		
					}
				}
				
			}else if(fybm.startsWith("1")||fybm.startsWith("2")||fybm.startsWith("M")||fybm.startsWith("9")) {//直辖市高院
				if(templateName.contains("spzx")) {
					for(int i=1;i<=2;i++) {
						dataMap.put("image"+i, NumUtil.getImageStr(reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11)+"/img/zx/"+date+"/"+type+"/gao/spzx/"+i+"/"+NumUtil.toSheng(fymc)+".png")); 
					}
				}else {
					for(int i=1;i<=14;i++) {
						dataMap.put("image"+i, NumUtil.getImageStr(reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11)+"/img/zx/"+date+"/"+type+"/gao/jjsh/"+i+"/"+NumUtil.toSheng(fymc)+".png")); 
					}
				}
				
			}else {//普通高院
				if(templateName.contains("spzx")) {
					for(int i=1;i<=20;i++) {
						dataMap.put("image"+i, NumUtil.getImageStr(reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11)+"/img/pt/"+date+"/"+type+"/gao/spzx/"+i+"/"+NumUtil.toSheng(fymc)+".png")); 		
					}
				}else if(templateName.contains("jjsh")){
					for(int i=1;i<=17;i++) {
						dataMap.put("image"+i, NumUtil.getImageStr(reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11)+"/img/pt/"+date+"/"+type+"/gao/jjsh/"+i+"/"+NumUtil.toSheng(fymc)+".png")); 		
					}
				}
				
			}
			
		}else if(kind.equals("中")){
			if(templateName.contains("spzx")) {
				gzzsService.getGkzsZy(dataMap, kind, type, date, fybm, fymc);//公开指数
				gzzsTszbService.getTszbZy(dataMap, kind, type, date, fybm, fymc);
				wdzsService.getWdzsZy(dataMap, kind, type, date, fybm, fymc);
				spzxxlzsService.getSpZxzsZy(dataMap, kind, type, date, fybm, fymc,"sp");//审判效率指数
				spzxxlzsService.getSpZxzsZy(dataMap, kind, type, date, fybm, fymc,"zx");//执行效率指数
				fpxszsService.getFpxszsZy(dataMap, kind, type, date, fybm, fymc,"ysfp");//服判息诉指数
				zxjazsService.getZxjazsZy(dataMap, kind, type, date, fybm, fymc);
				sfglcbrzsService.getSpZxgzlzsZy(dataMap, kind, type, date, fybm, fymc,"sp");
				sfglcbrzsService.getSpZxgzlzsZy(dataMap, kind, type, date, fybm, fymc,"zx");
				sfglFajhService.getFajhzsZy(dataMap, kind, type, date, fybm, fymc);
				sfglgjljzsService.getGjljzsZy(dataMap, kind, type, date, fybm, fymc);
				sfglydjazsService.getYdjajhzsZy(dataMap, kind, type, date, fybm, fymc);
				sfglRjjazsService.getRjajhzsZy(dataMap, kind, type, date, fybm, fymc);
				sfglCsxService.getCsxzsZy(dataMap, kind,csxdate, fybm, fymc);
				eqTyService.getEqTyzsZy(dataMap,"cqcsx", kind, "year", csxdate, fybm, fymc);
				eqTyService.getEqTyzsZy(dataMap,"duren", kind, type, date, fybm, fymc);
				//eqTyService.getEqTyzsZy(dataMap,"esfp", kind, type, date, fybm, fymc);
				eqTyService.getEqTyzsZy(dataMap,"psy", kind, type, date, fybm, fymc);
				eqTyService.getEqTyzsZy(dataMap,"tj", kind, type, date, fybm, fymc);	
				if(fybm.startsWith("1")||fybm.startsWith("2")||fybm.startsWith("M")||fybm.startsWith("9")) {
					headService.getheadzs(dataMap, "辖", type, date, fybm);
				}else {
					headService.getheadzs(dataMap, kind, type, date, fybm);
				}
				dataMap.put("image1", NumUtil.getZyImageStr(reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11)+"/img/temp.png",reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11)+"/img/zx/"+date+"/"+type+"/zhong/spzx/1/"+fymc.replace("法院", "")+".png")); 
			}else if(templateName.contains("jjsh")){
				String ssxq_gy =  ((Object[])tFypzService.getParentFymc(fybm,"gaoji").get(0))[0].toString();
				dataMap.put("ssxq", NumUtil.toSheng(ssxq_gy));
				shzlService.getShzlzsZy(dataMap, kind, "mjjd", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "lwjf", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "jrzp", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "dljt", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "rsaq", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "wcnqy", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "wcnfz", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "fnet", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "hdd", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "spaq", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "ypaq", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "grcc", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "jtjf", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "lljf", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "lyjf", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "zrzy", type, date, fybm, fymc);
				shzlService.getShzlzsZy(dataMap, kind, "sthj", type, date, fybm, fymc);
				List fymcList = tFypzService.getFymc(fybm);
				String parentFymc="";
	    		if(fymcList.size()>0) {
	    			parentFymc = fymcList.get(0).toString();
	    		}
			}
		}else {
			if(templateName.contains("spzx")) {
				headService.getheadzs(dataMap, kind, type, date, fybm);
				gzzsService.getQxZs(dataMap, kind, type, date, fybm);
				wdzsService.getQxZs(dataMap, kind, type, date, fybm);
				spzxxlzsService.getQxZs(dataMap, kind, type, date, fybm, "sp");
				spzxxlzsService.getQxZs(dataMap, kind, type, date, fybm, "zx");
				eqTyService.getQxZs(dataMap, kind, type, date, fybm, "duren");
				eqTyService.getQxZs(dataMap, kind, "year", csxdate, fybm, "cqcsx");
				fpxszsService.getQxZs(dataMap, kind, type, date, fybm, "ysfp");
				zxjazsService.getQxZs(dataMap, kind, type, date, fybm);
				eqTyService.getQxZs(dataMap, kind, type, date, fybm, "tj");
				eqTyService.getQxZs(dataMap, kind, type, date, fybm, "psy");
				sfglcbrzsService.getQxZs(dataMap, kind, type, date, fybm, "sp");
				sfglcbrzsService.getQxZs(dataMap, kind, type, date, fybm, "zx");
				sfglFajhService.getQxZs(dataMap, kind, type, date, fybm);
				sfglgjljzsService.getQxZs(dataMap, kind, type, date, fybm);
				sfglydjazsService.getQxZs(dataMap, kind, type, date, fybm);
				sfglRjjazsService.getQxZs(dataMap, kind, type, date, fybm);
				sfglCsxService.getQxZs(dataMap, kind, csxdate, fybm);
			}else {
				shzlService.getShzlzsQx(dataMap, kind, "mjjd", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "lwjf", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "jrzp", type, date, fybm);
				//shzlService.getShzlzsQx(dataMap, kind, "dljt", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "rsaq", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "wcnqy", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "wcnfz", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "fnet", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "hdd", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "spaq", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "ypaq", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "grcc", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "jtjf", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "lljf", type, date, fybm);
				//shzlService.getShzlzsQx(dataMap, kind, "lyjf", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "zrzy", type, date, fybm);
				shzlService.getShzlzsQx(dataMap, kind, "sthj", type, date, fybm);
			}
		}
	}
	
	public static void main(String[] args) {
		String reportPath = "/app/data/working_dir/wangshu/ztfx/report_sfzs/"; 
		System.out.println(reportPath.substring(0,reportPath.lastIndexOf("report_sfzs/")+11));;
	}
	
}
